package com.example.activity_service.service.impl;


import com.example.activity_service.dao.Msdao;
import com.example.activity_service.service.MsQueryService;
import com.example.activity_service.vo.StopWatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.Date;
import java.util.List;

@Service
public class MsServicelmpl implements MsQueryService {
    @Autowired
    Msdao userdao;
    @Override
    public List<StopWatch> huoqusj() {
        return userdao.huoqusj();
    }

    public List<StopWatch> huoqusj1() {
        return userdao.huoqusj1();
    }

    //    @Override
//    public String tjsj(String openingtime, String endtime) {
//        return userdao.tjsj(openingtime,endtime);
//    }
//添加时间
    @Override
    public int tjsj(StopWatch stopWatch) {
        return userdao.tjsj(stopWatch);
    }

    @Override
    public int gai(StopWatch stopWatch) {
        return userdao.gai(stopWatch);
    }

    @Override
    public List<StopWatch> qiehuan(StopWatch stopWatch) {
        return userdao.qiehuan(stopWatch);
    }

    //    查msid
    @Override
    public List<StopWatch> selectmsid(StopWatch stopWatch) {
        return userdao.msid(stopWatch);
    }

    //数量减一
    @Override
    public int jianyi(int goodsid) {
        return userdao.jianyi(goodsid);
    }

    //数量变成0 中间表
//    @Override
//    public int shuliang0() {
//        return userdao.shuliang0();
//    }

    @Override
    public List<StopWatch> chagoods() {
        return userdao.chagoods();
    }

    //    添加秒杀商品 表 秒杀价格 连接时间段 和
    @Override
    public int shangpintianjia(String openingtime, String spikeprice, String goodsid) {
//       int x=  userdao.chacommodityid(openingtime).getCommodityid();
        userdao.miaoshaguanliang(openingtime,goodsid);
        return userdao.shangpintianjia(openingtime,spikeprice,goodsid);
    }

    @Override
    public List<StopWatch> shouye(StopWatch stopWatch) {
        return userdao.shouye(stopWatch);
    }

}
